package com.heima.article.controller.v1;

import com.heima.article.service.ApAuthorService;
import com.heima.model.article.dtos.AuthorDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Fuqiang
 * @since :2023-03-25
 */
@RestController
public class ApAuthorController {

    @Autowired
    ApAuthorService apAuthorService;

    /**
     * 保存文章作者信息
     *
     * @param dto
     * @return 文章作者id
     */
    @PostMapping("/api/v1/author/save")
    public Integer save(@Validated @RequestBody AuthorDto dto) {

        return apAuthorService.createApAuthor(dto);
    }

}
